home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Techniques / Examples by Thomas Tempelmann / TT's Icons-Plugin / Source Code (CW Pro 3) / Plugin SDK v3 Includes / REALplugin.h < prev   
Encoding:
C/C++ Source or Header  |  1999-03-07  |  7.6 KB  |  313 lines

  1. #pragma once
  2.  
  3. struct REALstringStruct
  4. {
  5. // This structure is for examination purposes only!
  6. // Do not construct them yourself - use REALBuildString!
  7. private:
  8.     long mPrivateUsageCount;
  9.     unsigned char *mPrivateStringData;
  10.     long mPrivateAllocLength;
  11.     long mPrivateLength;
  12. public:
  13.     long Length(void);
  14.     const char *CString();
  15.     const unsigned char *PString();
  16. };
  17.  
  18. typedef REALstringStruct *REALstring;
  19.  
  20. typedef void (*REALproc)(void);
  21.  
  22. struct REALdbDatabaseStruct;
  23. typedef REALdbDatabaseStruct *REALdbDatabase;
  24.  
  25. struct REALdbCursorStruct;
  26. typedef REALdbCursorStruct *REALdbCursor;
  27.  
  28. struct REALcontrolInstanceStruct;
  29. typedef REALcontrolInstanceStruct *REALcontrolInstance;
  30.  
  31. struct REALgraphicsStruct;
  32. typedef REALgraphicsStruct *REALgraphics;
  33.  
  34. struct REALobjectStruct;
  35. typedef REALobjectStruct *REALobject;
  36.  
  37. struct REALfolderItemStruct;
  38. typedef REALfolderItemStruct *REALfolderItem;
  39.  
  40. struct REALpictureStruct;
  41. typedef REALpictureStruct *REALpicture;
  42.  
  43. struct REALsoundStruct;
  44. typedef REALsoundStruct *REALsound;
  45.  
  46. struct REALappleEventStruct;
  47. typedef REALappleEventStruct *REALappleEvent;
  48.  
  49. struct REALwindowStruct;
  50. typedef REALwindowStruct *REALwindow;
  51.  
  52. struct REALpopupMenuStruct;
  53. typedef REALpopupMenuStruct *REALpopupMenu;
  54.  
  55. struct REALmovieStruct;
  56. typedef REALmovieStruct *REALmovie;
  57.  
  58. struct REALmoviePlayerStruct;
  59. typedef REALmoviePlayerStruct *REALmoviePlayer;
  60.  
  61. struct REALsocketStruct;
  62. typedef REALsocketStruct *REALsocket;
  63.  
  64. #define REALnoImplementation ((REALproc) nil)
  65.  
  66. struct REALmethodDefinition
  67. {
  68.     REALproc function;
  69.     REALproc setterFunction;
  70.     const char *declaration;
  71. };
  72.  
  73. #define REALpropInvalidate 1
  74. #define REALpropRuntimeOnly 2
  75.  
  76. #define REALstandardGetter ((REALproc) -1)
  77. #define REALstandardSetter ((REALproc) -1)
  78.  
  79. struct REALproperty
  80. {
  81.     const char *group;
  82.     const char *name;
  83.     const char *type;
  84.     int flags;
  85.     REALproc getter;
  86.     REALproc setter;
  87.     int param;
  88.     REALproc editor;
  89.     int enumCount;
  90.     const char **enumEntries;
  91. };
  92.  
  93. struct REALevent
  94. {
  95.     const char *declaration;
  96.     int forSystemUse;
  97. };
  98.  
  99. struct REALeventInstance
  100. {
  101.     const char *name;
  102.     REALproc implementation;
  103. };
  104.  
  105. struct REALcontrolBehaviour
  106. {
  107.     void (*constructorFunction)(REALcontrolInstance);
  108.     void (*destructorFunction)(REALcontrolInstance);
  109. #ifdef WIN32
  110.     void (*redrawFunction)(REALcontrolInstance, REALgraphics context);
  111. #else
  112.     void (*redrawFunction)(REALcontrolInstance);
  113. #endif
  114.     Boolean (*clickFunction)(REALcontrolInstance, int, int, int);
  115.     void (*mouseDragFunction)(REALcontrolInstance, int, int);
  116.     void (*mouseUpFunction)(REALcontrolInstance, int, int);
  117.     void (*gainedFocusFunction)(REALcontrolInstance);
  118.     void (*lostFocusFunction)(REALcontrolInstance);
  119.     REALproc keyDownFunction;
  120.     void (*openFunction)(REALcontrolInstance);
  121.     void (*closeFunction)(REALcontrolInstance);
  122.     void (*backgroundIdleFunction)(REALcontrolInstance);
  123.     void (*drawOffscreenFunction)(REALcontrolInstance, REALgraphics context);
  124.     void (*setSpecialBackground)(REALcontrolInstance);
  125.     REALproc unusedFunction1;
  126.     REALproc unusedFunction2;
  127.     REALproc unusedFunction3;
  128.     REALproc unusedFunction4;
  129.     REALproc unusedFunction5;
  130.     REALproc unusedFunction6;
  131.     REALproc unusedFunction7;
  132.     REALproc unusedFunction8;
  133.     REALproc unusedFunction9;
  134. };
  135.  
  136. #define kCurrentREALControlVersion 3
  137.  
  138. #define REALcontrolAcceptFocus 1
  139. #define REALcontrolFocusRing 2
  140. #define REALinvisibleControl 4
  141. #define REALopaqueControl 8
  142. #define REALenabledControl 16
  143.  
  144. struct REALcontrol
  145. {
  146.     int version;
  147.     const char *name;
  148.     int dataSize;
  149.     int flags;
  150.     int toolbarPICT, toolbarDownPICT;
  151.     int defaultWidth, defaultHeight;
  152.     REALproperty *properties;
  153.     int propertyCount;
  154.     REALmethodDefinition *methods;
  155.     int methodCount;
  156.     REALevent *events;
  157.     int eventCount;
  158.     REALcontrolBehaviour *behaviour;
  159.     int forSystemUse;
  160. };
  161.  
  162. struct REALclassDefinition
  163. {
  164.     int version;
  165.     const char *name;
  166.     const char *superName;
  167.     int dataSize;
  168.     int forSystemUse;
  169.     REALproc constructor;
  170.     REALproc destructor;
  171.     REALproperty *properties;
  172.     int propertyCount;
  173.     REALmethodDefinition *methods;
  174.     int methodCount;
  175.     REALevent *events;
  176.     int eventCount;
  177.     REALeventInstance *eventInstances;
  178.     int eventInstanceCount;
  179.     const char *interfaces;
  180. };
  181.  
  182. #define kCurrentREALDatabaseVersion 1
  183.  
  184. struct dbDatabase;
  185. struct dbTable;
  186. struct dbCursor;
  187.  
  188. enum dbFieldType
  189. {
  190.     dbTypeNull,
  191.     dbTypeByte,
  192.     dbTypeShort,
  193.     dbTypeLong,
  194.     dbTypeChar,
  195.     dbTypeText,
  196.     dbTypeFloat,
  197.     dbTypeDouble,
  198.     dbTypeDate,
  199.     dbTypeCurrency,
  200.     dbTypeBoolean,
  201.     dbTypeDecimal,
  202.     dbTypeUnknown
  203. };
  204.  
  205. struct REALnewColumn
  206. {
  207.     REALnewColumn *nextColumn;
  208.     REALstring columnName;
  209.     long columnType;
  210.     long bAllowNULL;
  211. };
  212.  
  213. struct REALcolumnValue
  214. {
  215.     REALcolumnValue *nextColumn;
  216.     REALstring columnName;
  217.     REALstring columnValue;
  218. };
  219.  
  220. enum REALcolumnOperation
  221. {
  222.     rcOpEquals,
  223.     rcOpLessThan,
  224.     rcOpGreaterThan,
  225.     rcOpLessThanEqual,
  226.     rcOpGreaterThanEqual,
  227.     rcOpNotEqual,
  228.  
  229.     rcOpAnd,
  230.     rcOpOr
  231. };
  232.  
  233. struct REALcolumnConstraints
  234. {
  235.     REALcolumnConstraints *left, *right;
  236.     REALcolumnOperation columnOperation;
  237.     REALstring column;
  238.     REALstring value;
  239. };
  240.  
  241. struct REALgetColumn
  242. {
  243.     REALgetColumn *next;
  244.     REALstring column;
  245. };
  246.  
  247. enum {
  248.     dbEnginePrimaryKeySupported = 1,
  249.     dbEngineAlterTableAddParens = 2
  250. };
  251.  
  252. struct REALdbEngineDefinition
  253. {
  254.     int version;
  255.     unsigned char forSystemUse;
  256.     unsigned char flags1;
  257.     unsigned char flags2;
  258.     unsigned char flags3;
  259.  
  260.     void (*closeDatabase)(dbDatabase *); // void (*closeDatabase)(dbDatabase *);
  261.  
  262.     REALdbCursor (*getTableSchemaCursor)(dbDatabase *); // dbCursor *(*tableCursor)(dbDatabase *)) /* optional */
  263.     REALdbCursor (*getFieldSchemaCursor)(dbDatabase *, REALstring); // dbCursor *(*fieldCursor)(dbDatabase *, REALstring)) /* optional */
  264.  
  265.     REALdbCursor (*directSQLSelect)(dbDatabase *, REALstring); // DatabaseCursorObject (*directSQLSelect)(dbDatabase *, REALstring selectString);
  266.     void (*directSQLExecute)(dbDatabase *, REALstring); // void (*directSQLExecute)(dbDatabase *, REALstring executeString);
  267.  
  268.     void (*createTable)(dbDatabase *, REALstring, REALnewColumn *, unsigned char *, int); // void (*createTable)(dbDatabase *, REALstring name, REALnewColumn *columns, unsigned char *primaryKey, int primaryKeyCount);
  269.     void (*addTableRecord)(dbDatabase *, REALstring, REALcolumnValue *); // void (*addTableRecord)(dbDatabase *, REALstring tableName, REALcolumnValue *values);
  270.     REALdbCursor (*getTableCursor)(dbDatabase *, REALstring, REALgetColumn *, REALcolumnConstraints *); // DatabaseCursorObject *(*getTableCursor)(dbDatabase *, REALstring tableName, REALgetColumn *columns, REALcolumnConstraints *constraints);
  271. };
  272.  
  273. struct REALdbTableDefinition
  274. {
  275.     int version;
  276.     int forSystemUse;
  277.  
  278.     REALproc closeTable; // void (*closeTable)(dbTable *);
  279.     REALproc tableCursor; // dbCursor *(*tableCursor)(dbTable *);
  280. };
  281.  
  282. struct REALdbCursorDefinition
  283. {
  284.     int version;
  285.     int forSystemUse;
  286.  
  287.     void (*closeCursor)(dbCursor *);
  288.     int (*cursorColumnCount)(dbCursor *); // int (*cursorColumnCount)(dbCursor *);
  289.     REALstring (*cursorColumnName)(dbCursor *, int column); // REALstring (*cursorColumnName)(dbCursor *, int column); /* optional */
  290.     int (*cursorRowCount)(dbCursor *); // int (*cursorRowCount)(dbCursor *); /* optional */
  291.     void (*cursorColumnValue)(dbCursor *, int, Ptr *, dbFieldType *, int *); // void (*cursorColumnValue)(dbCursor *, int column, Ptr *value, dbFieldType *type, int *length);
  292.     void (*cursorReleaseValue)(dbCursor *); // void (*cursorReleaseValue)(dbCursor *); /* optional */
  293.     Boolean (*cursorNextRow)(dbCursor *); // Boolean (*cursorNextRow)(dbCursor *);
  294.     void (*cursorDelete)(dbCursor *); // void (*cursorDelete)(dbCursor *);
  295.     void (*cursorDeleteAll)(dbCursor *); // void (*cursorDeleteAll)(dbCursor *);
  296.     void *dummy1;
  297.     void *dummy2;
  298.     void *dummy3;
  299.     void *dummy4;
  300.     void *dummy5;
  301.     void *dummy6;
  302.     void *dummy7;
  303.     void *dummy8;
  304.     void *dummy9;
  305.     void *dummy10;
  306. };
  307.  
  308. #define FieldOffset(type, field) (long)(&((type *) 0)->field)
  309.  
  310. extern "C" {
  311. void PluginEntry(void);
  312. }
  313.